// 导入request.ts中的get和post
import { pa } from "element-plus/es/locales.mjs";
import { get, post } from "./request";
import { loginType, loginResponse ,Sysuseradd,SysuseraddResponse,Doctor, search,depInfoResponse,depInfoAddResponse,
    depInfoUpdateResponse,depInfpType,depInfoAddType,depInfoUpdateType,patient,page
} from "@/types/index";
//通过手机号和密码登录
export const loginApi = (params: loginType) => {
    // console.log(12);
    return post<loginResponse>('/sysuser/login', params)
}

// 注册用户
export const registerApi = (params: Sysuseradd) => {
    return post<SysuseraddResponse>('/sysuser/register', params);
}
export const getDoctorList = () => {
    return get<Doctor[]>('/doctormanage/all')
}

export const addDoctorApi = (params: Doctor) => {
    return post<Doctor>('/doctormanage/add',params)
}

export const uppdateDoctorApi = (params: Doctor) => {
    return post<Doctor>('/doctormanage/update',params)
}
export const searchDoctorApi = (params: search) => {
    return post<Doctor>('/doctormanage/search',params)
}
export const depInfoApi = (params:depInfpType)=>{
    return get<depInfoResponse[]>('/depinfo/getAllDepInfo',params)
}

export const depInfoAddApi = (params:depInfoAddType)=>{
    return post<depInfoAddResponse[]>('/depinfo/depAddInfo',params)
}
export const depInfoUpdateApi = (params:depInfoUpdateType) => {
    return post<depInfoUpdateResponse[]>('/depinfo/updateDepInfo',params)
} 
export const getPatientAllApi = () => {
    return get<patient[]>('/patient/all')
} 
export const getPatientPageApi = () => {
    return get<patient[]>('/patient/page',{})   
}
export const updatePatientApi = (params: patient) => {
    return post<Doctor>('/patient/update',params)
}
export const addPatientApi = (params: patient) => {
    return post<patient>('/patient/add',params)
}